public class test {
    public static void merge(int A[],int m,int B[],int n){
        for (int i = n; i < m; i++) {
            A[i]=B[i];
        }
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < m-i-1; j++) {
                if(A[j]>A[j+1]){
                    int tem=A[j];
                    A[j]=A[j+1];
                    A[j+1]=A[j];
                }
            }
        }
    }
    public static void main (String[] args) {
        int m=6,n=3;
        int []a={1,2,3,0,0,0};
        int []b={4,5,6};
        merge(a,m,b,n);
        System.out.println (a.toString ());

    }
}
